<script lang="ts" setup>
import { reactive } from 'vue'
const ecologyList = reactive([
    { id: 0, name: '润城通', cover: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101831114.png', img: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101871757.png', company: '润城新产业（深圳）有限公司', tag: ['园区服务', '企业服务', '产业服务'], des: '一键查看多个项目、园区、楼宇整体数据和总体概况，包括楼宇总面积、已出租面积、空置面积、可招商面积。',check:true},
    { id: 1, name: '润城招商', cover: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101831114.png', img: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101871757.png', company: '润城新产业（深圳）有限公司', tag: ['园区服务', '企业服务', '产业服务'], des: '一键查看多个项目、园区、楼宇整体数据和总体概况，包括楼宇总面积、已出租面积、空置面积、可招商面积。',check:false},
    { id: 2, name: '润城CRM', cover: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101831114.png', img: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101871757.png', company: '润城新产业（深圳）有限公司', tag: ['园区服务', '企业服务', '产业服务'], des: '一键查看多个项目、园区、楼宇整体数据和总体概况，包括楼宇总面积、已出租面积、空置面积、可招商面积。',check:false},
    { id: 2, name: '润城经纪人网店', cover: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101831114.png', img: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101871757.png', company: '润城新产业（深圳）有限公司', tag: ['园区服务', '企业服务', '产业服务'], des: '一键查看多个项目、园区、楼宇整体数据和总体概况，包括楼宇总面积、已出租面积、空置面积、可招商面积。',check:false},
    { id: 2, name: '润城自拓', cover: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101831114.png', img: 'https://park-platform.oss-cn-beijing.aliyuncs.com/2023101871757.png', company: '润城新产业（深圳）有限公司', tag: ['园区服务', '企业服务', '产业服务'], des: '一键查看多个项目、园区、楼宇整体数据和总体概况，包括楼宇总面积、已出租面积、空置面积、可招商面积。',check:false}
])

const handleChangeCarousel = (val:any) =>{
    ecologyList.map((item,index)=>{
        item.check = false
        if(index == val) item.check = true
    })
}

</script>

<template>
    <div class="carouselTitle bigTitle">相关产品</div>
    <el-carousel indicator-position="none" arrow="never" type="card" :autoplay="false" @change="handleChangeCarousel">
        <el-carousel-item v-for="item in ecologyList" :key="item"  :class="item.check ? 'opacity1' : 'opacity'">
            <div class="ecology_box">
                <el-row justify="space-between">
                <el-col :span="8" :xs="0">
                    <el-image :src="item.cover" style="object-fit: cover"></el-image>
                </el-col>
                <el-col :span="15" :xs="24">
                    <el-row justify="space-between">
                        <el-col :span="6" :xs="24">
                            <el-image class="ecology_image" :src="item.img"></el-image>
                        </el-col>
                        <el-col :span="18" :xs="24">
                            <div>
                            <div class="ecology_name">{{ item.name }}</div>
                            <div class="ecology_company new_info">{{ item.company }}</div>
                            <div class="ecology_tag">
                                <el-tag v-for="tagItem in item.tag" :key="tagItem" effect="plain" round>
                                    {{ tagItem }}
                                </el-tag>
                            </div>
                        </div>
                        </el-col>
                    </el-row>
                    <div class="ecology_des new_info">{{ item.des }}</div>
                </el-col>
            </el-row>
            </div>
        </el-carousel-item>
    </el-carousel>
</template>

<style lang="scss" scoped>
.carouselTitle{
    padding: 30px 0 40px 0;
    text-align: center;
}

.opacity1{
    opacity: 1;
}

.opacity{
    opacity: 0.5;
}
.el-carousel__item {
    color: #475669;
    margin: 0;
    text-align: center;
    height: auto;
    border-radius: 10px;
    text-align: left;
}

.el-carousel__item:nth-child(2n) {
    background-color: #fff;
}

.el-carousel__item:nth-child(2n + 1) {
    background-color: #fff;
}

.ecology_box {
    background-color: #fff;
    width: 100%;
    padding: 20px;
    border-radius: 10px;

    .ecology_image {
        width: 100%;
        border-radius: 10px;
    }

    .ecology_name {
        font-size: 28px;
        color: #172E59;
        font-family: alibabapuhuitiRegular;
        margin-left: 22px;
    }

    .ecology_company {
        margin: 8px 0 11px 22px;
    }

    .ecology_tag {
        margin-left: 22px;

        :deep(.el-tag) {
            color: #064DD6;
            border-color: #064DD6;
            margin-right: 10px;
            padding: 0 15px;
        }
    }

    .ecology_des {
        margin-top: 24px;
        font-size: 18px;
        color: #172E59;
        font-family: alibabapuhuitiRegular;
    }
}

@media screen and (max-width: 450px){

}
</style>